<template>
  <div class="qw">
    <!-- 头部组件 -->
    <el-card class="card">
      <el-form ref="form" :inline="true" :model="formIn" label-width="80px">
        <el-form-item label="点位搜索">
          <el-input
            v-model="formIn.user"
            placeholder="请选择"
            size="medium"
          />
        </el-form-item>
        <el-form-item label="区域搜素" size="medium">
          <el-select v-model="formIn·.regions" placeholder="请选择">
            <el-option label="区域一" value="shanghai" />
            <el-option label="区域二" value="beijing" />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button
            type="primary"
            icon="el-icon-search"
            size="medium"
            @click="onSubmit"
          >查询</el-button>
        </el-form-item>
      </el-form>
    </el-card>
    <!-- 表格区域 -->
    <el-card>
      <el-table :data="showList" style="width: 100%">
        <el-table-column type="index" label="序号" align="center" />
        <el-table-column prop="name" label="点位名称" align="center" />
        <el-table-column prop="regions.name" label="所在区域" align="center" />
        <el-table-column
          prop="businessType.name"
          label="商圈类型"
          align="center"
        />
        <el-table-column prop="ownerName" label="合作商" align="center" />
        <el-table-column prop="addr" label="详细地址" align="center" />
        <el-table-column label="操作" width="180" align="center">
          <template>
            <el-button type="text">查看详情</el-button>
            <el-button type="text">修改</el-button>
            <el-button type="text" style="color: red">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script>
import { SearchNode } from '@/api'
export default {
  data() {
    return {
      formIn: {
        // 表单数据
        user: '',
        regions: ''
      },
      params: {
        pageIndex: 1,
        pageSize: 10,
        name: ''
      },
      showList: [] // 页面数据
    }
  },
  created() {
    this.fetchArealist()
  },
  methods: {
    // 获取区域管理页面数据的方法
    async fetchArealist() {
      const { data } = await SearchNode(this.params)
      this.showList = data.currentPageRecords
      // item.addr.split('').slice(-1)
    },
    onSubmit() {}
  }
}
</script>
<style lang="scss">
.qw {
  margin-top: 70px;
  margin-left: 20px;
  margin-right: 10px;
}
.card {
  padding-top: 20px;
  margin-bottom: 15px;
}
</style>

